<template>
  <div class="manage-status">
    <div>统计值：--{{ count }}--</div>
    <div>语录：{{ other }}</div>
    <br />
    <button @click="sumFn(10)">+10</button>
  </div>
</template>

<script setup lang="ts" name="manageStatus">
import {useUser} from "@/store/modules/user";
import { storeToRefs } from 'pinia';

const user = useUser();
const { count,other } = storeToRefs(user);






function sumFn(num:number){
  //方式1
  // user.count += 10;


  // 方式2
  // user.$patch({
  //   count: user.count + 10,
  //   other: '加油！'
  // })

  // 方式3
  user.addSum(num);
}
</script>


<style  scoped>

</style>
